package com.dy.lock.screen.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.lock.screen.dao.AdvertDao;
import com.dy.lock.screen.dao.AdvertTagRelationDao;
import com.dy.lock.screen.pojo.AdvertInfo;
import com.dy.lock.screen.pojo.AdvertTagRelationInfo;
import com.dy.lock.screen.scoket.Head;
import com.dy.lock.screen.service.AdvertService;

@Service("advertService")
public class AdvertServiceImpl implements AdvertService {

	@Resource(name = "advertDao")
	private AdvertDao advertDao;
	@Resource(name = "advertTagRelationDao")
	private AdvertTagRelationDao advertTagRelationDao;

	@Override
	public List<AdvertInfo> queryByAdIds(Map<String, Object> map, Head head) {
		List<AdvertInfo> list = this.advertDao.queryByAdIds(map);
		return list;
	}

	@Override
	public List<AdvertInfo> queryAll(Map<String, Object> map, Head head) {
		List<AdvertInfo> list = this.advertDao.queryAll(map);
		return list;
	}

	@Override
	public List<AdvertTagRelationInfo> queryByAdId(String adId, Head head) {
		List<AdvertTagRelationInfo> list = this.advertTagRelationDao
				.queryByAdId(adId);
		return list;
	}

	@Override
	public AdvertInfo queryByPrimaryKey(String adId, Head head) {
		AdvertInfo adv = new AdvertInfo();
		adv.setAdId(adId);
		return advertDao.queryByPrimaryKey(adv);
	}

	@Override
	public int update(AdvertInfo advertInfo, Head head) {
		return this.advertDao.update(advertInfo);
	}

	@Override
	public List<String> queryWillDeleteId(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return this.advertDao.queryWillDeleteId(map);
	}

	@Override
	public List<String> queryByAdTag(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return this.advertTagRelationDao.queryByAdTag(map);
	}

}
